package com.erp.purchase.service.impl;

import java.util.List;

import com.erp.purchase.domain.PurOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.erp.purchase.mapper.PurOrderMapper;
import com.erp.purchase.domain.PurOrder;
import com.erp.purchase.service.IPurOrderService;

/**
 * 采购订单Service业务层处理
 *
 * @author hfw
 * @date 2025-09-04
 */
@Service
public class PurOrderServiceImpl implements IPurOrderService
{
    @Autowired
    private PurOrderMapper purOrderMapper;

    /**
     * 查询采购订单（基础信息）
     *
     * @param id 采购订单主键
     * @return 采购订单
     */
    @Override
    public PurOrder selectPurOrderById(Long id)
    {
        return purOrderMapper.selectPurOrderById(id);
    }
    
    /**
     * 查询采购订单（包含订单项详情）
     *
     * @param id 采购订单主键
     * @return 采购订单VO
     */
    @Override
    public PurOrderVO selectPurOrderVOById(Long id)
    {
        return purOrderMapper.selectPurOrderVOById(id);
    }

    /**
     * 查询采购订单列表
     *
     * @param purOrderVO 采购订单
     * @return 采购订单
     */
    @Override
    public List<PurOrderVO> selectPurOrderList(PurOrderVO purOrderVO)
    {
        return purOrderMapper.selectPurOrderList(purOrderVO);
    }

    /**
     * 新增采购订单
     *
     * @param purOrder 采购订单
     * @return 结果
     */
    @Override
    public int insertPurOrder(PurOrder purOrder)
    {
        return purOrderMapper.insertPurOrder(purOrder);
    }

    /**
     * 修改采购订单
     *
     * @param purOrder 采购订单
     * @return 结果
     */
    @Override
    public int updatePurOrder(PurOrder purOrder)
    {
        return purOrderMapper.updatePurOrder(purOrder);
    }

    /**
     * 批量删除采购订单
     *
     * @param ids 需要删除的采购订单主键
     * @return 结果
     */
    @Override
    public int deletePurOrderByIds(Long[] ids)
    {
        return purOrderMapper.deletePurOrderByIds(ids);
    }

    /**
     * 删除采购订单信息
     *
     * @param id 采购订单主键
     * @return 结果
     */
    @Override
    public int deletePurOrderById(Long id)
    {
        return purOrderMapper.deletePurOrderById(id);
    }
}
